import React from 'react'

interface City{
  from?:string,
  to?:string,
  change?():void
}

let ChangeCity: React.FC<City> = (props)=>{
    let {from, to, change} = props
    console.log(from,to)
    return <div>
          <span>{from}</span>
          <span onClick={()=>{
              change && change()
          }}>《---》</span>
          <span>{to}</span>
    </div>
}

export default ChangeCity